<div class="users index">
	
	<h2>
		<?php echo $this->Html->image("/admin/images/icons/icon_users.png"); ?>
		<?php echo __('Users'); ?>
	</h2>
	
	<?php echo $this->Html->link(__('Add'), array('action' => 'add'), array('class' => 'button add')); ?>
	
	<table cellpadding="0" cellspacing="0">
		<?php if( !$users): ?>
		<tr>
			<td><?php echo __("No Users found."); ?></td>
		</tr>
		<?php else: ?>
		<tr>
			<th><?php echo $this->Paginator->sort('id', __('ID'));?></th>
			<th><?php echo $this->Paginator->sort('name', __('Name'), array('escape' => false));?></th>
			<th><?php echo $this->Paginator->sort('email', __('Email'), array('escape' => false));?></th>
			<th class="actions"><?php echo __('Actions'); ?></th>
		</tr>
		<?php foreach($users as $user): ?>
		<tr>
			<td><?php echo $user['User']['id']; ?>&nbsp;</td>
			<td><?php echo $this->Html->link($user['User']['name'], array('action' => 'view', $user['User']['id'])); ?>&nbsp;</td>
			<td><?php echo $this->Text->autoLink($user['User']['email']); ?>&nbsp;</td>
			<td>
			<?php
				// view
				echo $this->Html->link(
					__('View'),
					array('action' => 'view', $user['User']['id']),
					array('escape' => false, 'class' => 'button view')
				);
				// edit
				echo $this->Html->link(
					__('Edit'),
					array('action' => 'edit', $user['User']['id']),
					array('escape' => false, 'class' => 'button edit')
				);
				// delete
				echo $this->Html->link(
					__('Delete'),
					array('action' => 'delete', $user['User']['id']),
					array('escape' => false, 'class' => 'button delete'),
					__("Are you sure you want to delete this User?")
				);
			?>
			</td>
		</tr>
		<?php endforeach; ?>
		<?php endif; ?>
	</table>
	
	<?php if($users): ?>
	<!-- PAGINATION -->
	<div class="pagination">
		<p><?php
		echo $this->Paginator->counter(array(
			'format' => __('Page {:page} of {:pages}')
		));?></p>
		<div class="paging">
		<?php
			echo $this->Paginator->prev(' < ', array(), null, array('class' => 'prev disabled'));
			echo $this->Paginator->numbers(array('separator' => ''));
			echo $this->Paginator->next(' > ', array(), null, array('class' => 'next disabled'));
		?>
		</div>
	</div>
	<?php endif; ?>
	
</div>
